Skip to content

remove freq parameter from gaps.completeness functions#236

Merged
cwhanse merged 3 commits into
pvlib:mainfrom
cwhanse:timedelta
Jul 7, 2026
Merged

remove freq parameter from gaps.completeness functions#236
cwhanse merged 3 commits into
pvlib:mainfrom
cwhanse:timedelta

Conversation

@cwhanse

@cwhanse cwhanse commented Jul 6, 2026

Copy link
Copy Markdown
Member
  • Closes #xxx
  • Added tests to cover all new or modified code.
  • Clearly documented all new API functions with PEP257 and numpydoc compliant docstrings.
  • Added new API functions to docs/api.rst.
  • Non-API functions clearly documented with docstrings or comments as necessary.
  • Adds description and name entries in the appropriate "what's new" file
    in docs/whatsnew
    for all changes. Includes link to the GitHub Issue with :issue:`num`
    or this Pull Request with :pull:`num`. Includes contributor name
    and/or GitHub username (link with :ghuser:`user`).
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

gaps.completeness and gaps.completeness_score require input to be a Series with DatetimeIndex, but also optionally accept a freq parameter for the input Series. If provided, the freq parameter is used to compute the number of seconds between Series values. The path for calculation involves pandas functions (infer_freq and to_timedelta) that are inconsistent in their use of frequency strings. See this error for the possible result.

pandas has a reported bug pandas-dev/pandas#36769 for several years and it appears unlikely that the behavior will be changed.

The number of seconds can be had from the Series index, so I'm removing the freq parameter as a way to avoid the pandas issues.

@cwhanse cwhanse added the bug Something isn't working label Jul 6, 2026
@cwhanse cwhanse added this to the v0.2.3 milestone Jul 6, 2026
cwhanse added 2 commits July 6, 2026 11:37
Updated the release notes for version 0.2.3 to reflect changes in function parameters and requirements.
@cwhanse cwhanse merged commit ea119dd into pvlib:main Jul 7, 2026
3 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant